﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZHDJ.Core;
using ZHDJ.Data.DataCaching;
using ZHDJ.Data.Models.Common;
using ZHDJ.WebPage;

namespace ZHDJ.Web.Portal.Grassroots
{
    public partial class ItemWorkTrendDetail : PortalPage
    {
        #region 页面属性

        public string TrendID
        {
            get { return this.Request["id"] ?? "null"; }
        }

        public string ItemID { get; set; }

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            ItemID = "";
            var model = DB.PartyGrassrootsWorkTrends.Find(TrendID);
            if (model == null)
            {
                RedirectToDefault();
            }
            var item = DB.PartyGrassrootsGroupItems.Find(model.ItemID);
            litItemName.Text = item.ItemName;
            ItemID = model.ItemID;
            this.lblTitle.Text = model.Title;
            this.lblTime.Text = "日期：" + Convert.ToDateTime(model.WorkTime).ToString("yyyy-MM-dd");
            this.lbBranch.Text = "发布：" + SystemParameterCaching.Get(SystemParameterKey.WebArticleHostName) +
                                 "&nbsp;驻点工作室：" + item.ItemName;
            this.ltContent.Text = model.Content;
        }
    }
}